algalcommand.script
Class ScriptManager
java.lang.Object
algalcommand.script.ScriptManager
- All Implemented Interfaces:
- PBRDataListener
public class ScriptManager
- extends java.lang.Object
- implements PBRDataListener
The ScriptManager class is the master controller for Pbotobioreactor (PBR)
behavior. This class has several important duties:
- Create a ScriptEngine for running JavaScripts
- Prep the ScriptEngine by putting the PBR object in the script's bindings
and running the PBRHeader.js script file
- Hold and run the script file chosen by the user
- Cleanly handle a change in the script file at runtime and the user
changing which file to use through teh GUI
- Call the appropriate functions from the script file in responce to
incoming data from the PBR.
- Save and load the state of the script file for interruptable execution
Copyright Owner:
Michigan State University, license number TEC2011-002101Prov
|
Field Summary |
static java.lang.String |
TAGNAME
XML tag for saving configuration |
|
Method Summary |
void |
dataReceived(PBRDataEvent data)
This method is part of the DataEventListener interface. |
void |
loadConfig(org.w3c.dom.Element scriptTag)
|
org.w3c.dom.Element |
saveConfig(org.w3c.dom.Document owner)
Note that the values of global variables in the script will not be
saved in the configuration, but can be saved and loaded using the
provided utilities. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TAGNAME
public static final java.lang.String TAGNAME
- XML tag for saving configuration
- See Also:
- Constant Field Values
ScriptManager
public ScriptManager()
dataReceived
public void dataReceived(PBRDataEvent data)
- This method is part of the DataEventListener interface.
- Specified by:
dataReceived in interface PBRDataListener
- Parameters:
data - Data sent from the PBR. Use the getMeasurementType()
method to find out what kind of data it is.
saveConfig
public org.w3c.dom.Element saveConfig(org.w3c.dom.Document owner)
- Note that the values of global variables in the script will not be
saved in the configuration, but can be saved and loaded using the
provided utilities.
- Parameters:
owner -
- Returns:
loadConfig
public void loadConfig(org.w3c.dom.Element scriptTag)